package com.app.service.impl;

import com.app.mapper.JumpMapper;
import com.app.model.JumpModel;
import com.app.service.JumpService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class JumpServiceImpl implements JumpService {
    @Autowired
    private JumpMapper jumpMapper;

    @Override
    public void update(JumpModel jumpModel) {
        jumpMapper.updateById(jumpModel);
    }

    @Override
    public void insert(JumpModel jumpModel) {
        jumpMapper.insert(jumpModel);
    }

    @Override
    public void delete(Integer id) {
        jumpMapper.deleteById(id);
    }

    @Override
    public Page<JumpModel> selectCarList(Integer page, Integer limit) {
        Page<JumpModel> pages = new Page<>();
        pages.setCurrent(page);
        pages.setSize(limit);
        return jumpMapper.selectPage(pages,null);
    }

    @Override
    public JumpModel getById(Integer id) {
        return jumpMapper.selectById(id);
    }
}
